#include <QtGui/QGuiApplication>
#include <QtGui/QOpenGLWindow>

class MyOpenGLWindow : public QOpenGLWindow
{
public:
	MyOpenGLWindow()
		: QOpenGLWindow(Q_NULLPTR, NoPartialUpdate, Q_NULLPTR)
	{
	}

protected:
	virtual void initializeGL() override {
		glClearColor(1.0f, 0.5f, 0.5f, 1.0f);
	}
	virtual void paintGL() override {
		glClear(GL_COLOR_BUFFER_BIT);
	}
	// virtual void paintOverGL() override {}
	// virtual void paintUnderGL() override {}
	virtual void resizeGL(int w, int h) override {
		glViewport(0, 0, w, h);
	}
};

int main(int argc, char **argv)
{

	QGuiApplication app(argc, argv);

	MyOpenGLWindow win;
	win.show();

	app.exec();
}